home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsITreeBoxObject.idl < prev    next >
Text File  |  2006-05-08  |  6KB  |  185 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   Dave Hyatt <hyatt@mozilla.org> (Original Author)
  24.  *   Ben Goodger <ben@netscape.com>
  25.  *   Jan Varga <varga@ku.sk>
  26.  *
  27.  * Alternatively, the contents of this file may be used under the terms of
  28.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  29.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  30.  * in which case the provisions of the GPL or the LGPL are applicable instead
  31.  * of those above. If you wish to allow use of your version of this file only
  32.  * under the terms of either the GPL or the LGPL, and not to allow others to
  33.  * use your version of this file under the terms of the MPL, indicate your
  34.  * decision by deleting the provisions above and replace them with the notice
  35.  * and other provisions required by the GPL or the LGPL. If you do not delete
  36.  * the provisions above, a recipient may use your version of this file under
  37.  * the terms of any one of the MPL, the GPL or the LGPL.
  38.  *
  39.  * ***** END LICENSE BLOCK ***** */
  40.  
  41. #include "nsISupports.idl"
  42. #include "domstubs.idl"
  43.  
  44. interface nsITreeView;
  45. interface nsITreeSelection;
  46. interface nsITreeColumn;
  47. interface nsITreeColumns;
  48.  
  49. [scriptable, uuid(55f3b431-1aa8-4e23-ad3d-a9f5644bdaa6)]
  50. interface nsITreeBoxObject : nsISupports
  51. {
  52.   /**
  53.    * Obtain the columns.
  54.    */
  55.   readonly attribute nsITreeColumns columns;
  56.  
  57.   /**
  58.    * The view that backs the tree and that supplies it with its data.
  59.    * It is dynamically settable, either using a view attribute on the
  60.    * tree tag or by setting this attribute to a new value.
  61.    */
  62.   attribute nsITreeView view;
  63.  
  64.   /**
  65.    * Whether or not we are currently focused.
  66.    */
  67.   attribute boolean focused;
  68.  
  69.   /**
  70.    * Obtain the treebody content node
  71.    */
  72.   readonly attribute nsIDOMElement treeBody;
  73.  
  74.   /**
  75.    * Obtain the height of a row.
  76.    */
  77.   readonly attribute long rowHeight;
  78.  
  79.   /**
  80.    * Get the index of the first visible row.
  81.    */
  82.   long getFirstVisibleRow();
  83.  
  84.   /**
  85.    * Get the index of the last visible row.
  86.    */
  87.   long getLastVisibleRow();
  88.  
  89.   /**
  90.    * Gets the number of possible visible rows.
  91.    */
  92.   long getPageLength();
  93.  
  94.   /**
  95.    * Ensures that a row at a given index is visible.
  96.    */
  97.   void ensureRowIsVisible(in long index);
  98.  
  99.   /**
  100.    * Scrolls such that the row at index is at the top of the visible view.
  101.    */
  102.   void scrollToRow(in long index);
  103.  
  104.   /**
  105.    * Scroll the tree up or down by numLines lines. Positive
  106.    * values move down in the tree. Prevents scrolling off the
  107.    * end of the tree. 
  108.    */
  109.   void scrollByLines(in long numLines);
  110.  
  111.   /**
  112.    * Scroll the tree up or down by numPages pages. A page
  113.    * is considered to be the amount displayed by the tree.
  114.    * Positive values move down in the tree. Prevents scrolling
  115.    * off the end of the tree.
  116.    */
  117.   void scrollByPages(in long numPages);
  118.   
  119.   /**
  120.    * Invalidation methods for fine-grained painting control.
  121.    */
  122.   void invalidate();
  123.   void invalidateColumn(in nsITreeColumn col);
  124.   void invalidateRow(in long index);
  125.   void invalidateCell(in long row, in nsITreeColumn col);
  126.   void invalidateRange(in long startIndex, in long endIndex);
  127.  
  128.   /**
  129.    * A hit test that can tell you what row the mouse is over.
  130.    * returns -1 for invalid mouse coordinates.
  131.    *
  132.    * The coordinate system is the client coordinate system for the
  133.    * document this boxObject lives in, and the units are CSS pixels.
  134.    */
  135.   long getRowAt(in long x, in long y);
  136.  
  137.   /**
  138.    * A hit test that can tell you what cell the mouse is over.  Row is the row index
  139.    * hit,  returns -1 for invalid mouse coordinates.  ColID is the column hit.
  140.    * ChildElt is the pseudoelement hit: this can have values of
  141.    * "cell", "twisty", "image", and "text".
  142.    *
  143.    * The coordinate system is the client coordinate system for the
  144.    * document this boxObject lives in, and the units are CSS pixels.
  145.    */
  146.   void getCellAt(in long x, in long y, out long row, out nsITreeColumn col, out ACString childElt);
  147.  
  148.   /** 
  149.    * Find the coordinates of an element within a specific cell. 
  150.    */
  151.   void getCoordsForCellItem(in long row, in nsITreeColumn col, in ACString element, 
  152.                             out long x, out long y, out long width, out long height);
  153.  
  154.   /** 
  155.    * Determine if the text of a cell is being cropped or not.
  156.    */
  157.   boolean isCellCropped(in long row, in nsITreeColumn col);
  158.  
  159.   /**
  160.    * The view is responsible for calling these notification methods when
  161.    * rows are added or removed.  Index is the position at which the new
  162.    * rows were added or at which rows were removed.  For
  163.    * non-contiguous additions/removals, this method should be called multiple times.
  164.    */
  165.   void rowCountChanged(in long index, in long count);
  166.   
  167.   /**
  168.    * Notify the tree that the view is about to perform a batch
  169.    * update, that is, add, remove or invalidate several rows at once.
  170.    * This must be followed by calling endUpdateBatch(), otherwise the tree
  171.    * will get out of sync.
  172.    */
  173.   void beginUpdateBatch();
  174.  
  175.   /**
  176.    * Notify the tree that the view has completed a batch update.
  177.    */
  178.   void endUpdateBatch();
  179.  
  180.   /**
  181.    * Called on a theme switch to flush out the tree's style and image caches.
  182.    */
  183.   void clearStyleAndImageCaches();
  184. };
  185.